﻿// JAW Edit Version 1.10
// August 19 2007
// Alan To 
// modified by Toby Lawrence (Apr 16 2008)

using System;
using System.Collections.Generic;
using System.Text;
using System.Data;

namespace JAW
{
	/// <summary>
	/// Contains lookup values for AFR/Lambda values and different sensor Vout profiles.
	/// </summary>
	public static class LookupValues
	{
		/// <summary>
		/// Holds the look up values to finding the air-to-fuel ratio.
		/// </summary>
		/// <remarks>
		/// JAW sends a value between 0 and 83 that is used as the index to get the correct air-to-fuel ratio.
		/// </remarks>
		public static readonly double[] AFR = { 34.28, 33.26, 32.28, 31.33, 30.43, 29.56, 28.73, 27.93, 27.17, 26.43, 25.73, 25.06, 24.41, 23.80, 23.21, 22.64, 22.10, 21.59, 21.10, 20.62, 20.17, 19.74, 19.32, 18.93, 18.55, 18.18, 17.83, 17.49, 17.16, 16.84, 16.53, 16.23, 15.94, 15.65, 15.37, 15.10, 14.70, 14.68, 14.53, 14.38, 14.24, 14.10, 13.97, 13.84, 13.71, 13.59, 13.47, 13.35, 13.23, 13.12, 13.01, 12.91, 12.80, 12.70, 12.60, 12.51, 12.41, 12.32, 12.23, 12.14, 12.05, 11.96, 11.88, 11.80, 11.72, 11.64, 11.56, 11.48, 11.40, 11.32, 11.25, 11.17, 11.10, 11.02, 10.95, 10.87, 10.80, 10.72, 10.64, 10.57, 10.49, 10.42, 10.34, 10.26, 10.18 };

		/// <summary>
		/// Holds the look up values to finding the lambda value.
		/// </summary>
		/// <remarks>
		/// JAW sends a value between 0 and 83 that is used as the index to get the correct lambda value.
		/// </remarks>
		public static readonly double[] Lambda = { 2.33, 2.26, 2.20, 2.13, 2.07, 2.01, 1.95, 1.90, 1.85, 1.80, 1.75, 1.70, 1.66, 1.62, 1.58, 1.54, 1.50, 1.47, 1.44, 1.40, 1.37, 1.34, 1.31, 1.29, 1.26, 1.24, 1.21, 1.19, 1.17, 1.15, 1.12, 1.10, 1.08, 1.06, 1.05, 1.03, 1.00, 1.00, 0.99, 0.98, 0.97, 0.96, 0.95, 0.94, 0.93, 0.92, 0.92, 0.91, 0.90, 0.89, 0.89, 0.88, 0.87, 0.86, 0.86, 0.85, 0.84, 0.84, 0.83, 0.83, 0.82, 0.81, 0.81, 0.80, 0.80, 0.79, 0.79, 0.78, 0.78, 0.77, 0.77, 0.76, 0.75, 0.75, 0.74, 0.74, 0.73, 0.73, 0.72, 0.72, 0.71, 0.71, 0.70, 0.70, 0.69 };
		
		/// <summary>
		/// Vout values corresponding with AFR/10.
		/// </summary>
		/// <remarks>
		/// Maps to the values in the AFR array used for JAW output.
		/// </remarks>
		public static readonly double[] JAWVoltages = { 3.43, 3.33, 3.23, 3.13, 3.04, 2.96, 2.87, 2.79, 2.72, 2.64, 2.57, 2.51, 2.44, 2.38, 2.32, 2.26, 2.21, 2.16, 2.11, 2.06, 2.02, 1.97, 1.93, 1.89, 1.85, 1.82, 1.78, 1.75, 1.72, 1.68, 1.65, 1.62, 1.59, 1.57, 1.54, 1.51, 1.47, 1.47, 1.45, 1.44, 1.42, 1.41, 1.40, 1.38, 1.37, 1.36, 1.35, 1.33, 1.32, 1.31, 1.30, 1.29, 1.28, 1.27, 1.26, 1.25, 1.24, 1.23, 1.22, 1.21, 1.21, 1.20, 1.19, 1.18, 1.17, 1.16, 1.16, 1.15, 1.14, 1.13, 1.12, 1.12, 1.11, 1.10, 1.09, 1.09, 1.08, 1.07, 1.06, 1.06, 1.05, 1.04, 1.03, 1.03, 1.02 };
		
		/// <summary>
		/// Vout values for emulating an Innovative LC-1 wideband sensor.
		/// </summary>
		/// <remarks>
		/// Maps to the values in the AFR array used for JAW output.
		/// </remarks>
		public static readonly double[] LC1Voltages = { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 4.84, 4.71, 4.51, 4.35, 4.2, 4.06, 3.94, 3.8, 3.71, 3.55, 3.45, 3.35, 3.25, 3.1, 3, 2.9, 2.8, 2.75, 2.65, 2.51, 2.51, 2.45, 2.39, 2.35, 2.29, 2.25, 2.2, 2.16, 2.1, 2.1, 2.06, 2, 1.94, 1.94, 1.9, 1.84, 1.8, 1.8, 1.75, 1.71, 1.71, 1.65, 1.65, 1.61, 1.55, 1.55, 1.51, 1.51, 1.45, 1.45, 1.39, 1.39, 1.35, 1.35, 1.29, 1.25, 1.25, 1.2, 1.2, 1.16, 1.16, 1.1, 1.1, 1.06, 1.06, 1, 1, 0.94 };
		
		/// <summary>
		/// Vout values for emulating a narrowband sensor.
		/// </summary>
		/// <remarks>
		/// Maps to the values in the AFR array used for JAW output.
		/// </remarks>
		public static readonly double[] NarrowbandVoltages = { 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.029, 0.031, 0.031, 0.031, 0.031, 0.032, 0.034, 0.035, 0.038, 0.045, 0.05, 0.055, 0.063, 0.080, 0.101, 0.13, 0.163, 0.197, 0.353, 0.372, 0.512, 0.610, 0.641, 0.683, 0.688, 0.718, 0.73, 0.741, 0.763, 0.77, 0.78, 0.785, 0.792, 0.797, 0.805, 0.810, 0.818, 0.825, 0.832, 0.837, 0.841, 0.848, 0.852, 0.852, 0.869, 0.871, 0.871, 0.871, 0.871, 0.871, 0.872, 0.872, 0.872, 0.872, 0.873, 0.873, 0.873, 0.873, 0.873, 0.874, 0.874, 0.874, 0.874, 0.875, 0.875, 0.875, 0.875 };
	}
}
